#pragma once
template <class T = int>
class QueueInterface
{
protected:
	deque<T> queue;
	unsigned int length;
	int type;
public:
	const static int FIFO = 0;
	const static int LIFO = 1;

	QueueInterface(int type, int length) : type(type), length(length) {
		if(length==-1) length = INT_MAX;
	}
	bool push(T item) {
		if(queue.size() >= length) 
			return false;

		if(type == FIFO)
			queue.push_back(item);
		else if(type == LIFO)
			queue.push_front(item);
		else
			return false; //TODO exception or smth
		return true;
	}

	T get() { return queue.front(); }
	void pop() { return queue.pop_front(); }
	int getLimit() { return length; }
	int getLength() { return queue.size(); }

};

